Learn R Programming

sdm (version 1.2-55)

Extract by index: Indexing to extract records of a sdmdata object

Description

This function extracts records of a sdmdata object and generates a new object of the same type (if drop=FALSE; otherwise a data.frame). In sdmdata, rID is the unique ID for each record.

Arguments

Methods

x[i]

Arguments rll x a Raster* object
i an index: record id (rID) in sdmdata object
drop If TRUE, a data.frame is returned, otherwise a sdmdata object is returned.

References

Naimi, B., Araujo, M.B. (2016) sdm: a reproducible and extensible R platform for species distribution modelling, Ecography, 39:368-375, DOI: 10.1111/ecog.01881

Examples

Run this code

file <- system.file("external/data.sdd", package="sdm")

d <- read.sdm(file)

# see the number of records:
d 
 
d2 <- d[1:10]

d2
 
d3 <- d[1:10,drop=TRUE]
 
d3

Run the code above in your browser using DataLab